'use strict';

module.exports = app => {
    class TeachingController extends app.Controller {

        //教师模块主页
        async teaching() {
            const notice = await this.service.teaching.teaching();
            await this.ctx.render("/teaching/teaching.html",{notice});
        };


        //公告详情
        async ann(){
            const params = this.ctx.request.query;
            const data = await this.service.teaching.ann(params);
            // const comment = await this.service.comment.getPostComment(params);
            await this.ctx.render("/teaching/ann.html",{data});
        };


        //课件列表
        async prepare(){
            const data = await this.service.teaching.prepare();
            await this.ctx.render('/teaching/prepare/prepare.html',{data});
        };


        //课件详情
        async preparedetail(){
            const params = this.ctx.request.query;
            const data = await this.service.teaching.preparedetail(params);
            await this.ctx.render('/teaching/prepare/prepare-detail.html',{data});
        }


        //学习分析
        async analysis(){
            await this.ctx.render('/teaching/analysis.html');
        }


    }
    return TeachingController;
};

